﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Media.Imaging;

namespace PhotoPuzzle
{
	public partial class Pictrue : UserControl
	{
		public Pictrue()
		{
			// Required to initialize variables
			InitializeComponent();
            pictrue_null.MouseLeftButtonUp += new MouseButtonEventHandler(pictrue_null_MouseLeftButtonDown);
		}

        void pictrue_null_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if(GameGlobal.Language == EmLanguage.CN)
                MessageBox.Show("需要解谜前面关卡！");
            else
                MessageBox.Show("Need to solve the puzzle of front pass!");
        }
        public bool IsNull
        {
            get
            {
                if (pictrue_null.Visibility == System.Windows.Visibility.Visible)
                    return true;
                else
                    return false;
            }
        }
        public BitmapImage ButtonImageSource
        {
            get
            {
                return imageout.Source as BitmapImage;
            }
            set
            {
                imageout.Source = value;
                if(value == null)
                    pictrue_null.Visibility = System.Windows.Visibility.Visible;
                else
                    pictrue_null.Visibility = System.Windows.Visibility.Collapsed;
            }
        }
        bool isSelect = false;
        public bool IsSelect
        {
            get { return isSelect; }
            set
            {
                if (value)
                    rectsel.Visibility = System.Windows.Visibility.Visible;
                else
                    rectsel.Visibility = System.Windows.Visibility.Collapsed;
                isSelect = value;
            }
        }
	}
}